package me.yangxy.learning.api;

import me.yangxy.learning.api.vo.AddContentReq;
import me.yangxy.learning.api.vo.Book;
import me.yangxy.learning.api.vo.DirectoryItemVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 中英文词典对象接口
 *
 */
@RestController("/directory")
public interface DirectoryService {

    /**
     *
     * @param data 需要添加的数据 data that is goona be added into database
     * @return
     */
    @RequestMapping("/addData")
    void addContent(@RequestParam("data") AddContentReq data);


    @RequestMapping("/addDatas")
    void addContents(@RequestParam("datas") List<AddContentReq> datas);


    /**
     * 获取所有
     * @return
     */
    @RequestMapping("/queryAll")
    List<DirectoryItemVO> queryAllContent();


    /**
     * 根据ID查询
     * @param id
     * @return
     */
    DirectoryItemVO queryById(Integer id);
}
